package com.thinkgem.jeesite.modules.sys.utils;

import com.thinkgem.jeesite.common.utils.SpringContextHolder;
import com.thinkgem.jeesite.modules.book.dao.BooksDao;
import com.thinkgem.jeesite.modules.book.entity.BkBooks;

import java.util.ArrayList;
import java.util.List;

/**
 * PublisherUtils
 * Created by aulbrother on 2015/12/21.
 */
public class BooksUtils{
    private static BooksDao booksDao = SpringContextHolder.getBean(com.thinkgem.jeesite.modules.book.dao.BooksDao.class);

    public static List<BkBooks> getBooksList(){
        List<BkBooks> all = new ArrayList<>();
        all.add(new BkBooks("", "全部", "0"));

        List<BkBooks> list = booksDao.findList(null);
        for(BkBooks books:list){
            books.setId(books.getBooksName());
        }

        all.addAll(list);
        return all;
    }
}
